/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
package app.cash.redwood.yoga.internal

import app.cash.redwood.yoga.internal.enums.YGAlign
import app.cash.redwood.yoga.internal.enums.YGDirection
import app.cash.redwood.yoga.internal.enums.YGEdge
import app.cash.redwood.yoga.internal.enums.YGFlexDirection
import app.cash.redwood.yoga.internal.enums.YGWrap
import kotlin.test.Test
import kotlin.test.assertEquals

class YGAlignContentTest {
    @Test
    fun align_content_flex_start() {
        val config = Yoga.YGConfigNew()
        val root = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetFlexDirection(root, YGFlexDirection.YGFlexDirectionRow)
        Yoga.YGNodeStyleSetFlexWrap(root, YGWrap.YGWrapWrap)
        Yoga.YGNodeStyleSetWidth(root, 130f)
        Yoga.YGNodeStyleSetHeight(root, 100f)
        val root_child0 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child0, 50f)
        Yoga.YGNodeStyleSetHeight(root_child0, 10f)
        Yoga.YGNodeInsertChild(root, root_child0, 0)
        val root_child1 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child1, 50f)
        Yoga.YGNodeStyleSetHeight(root_child1, 10f)
        Yoga.YGNodeInsertChild(root, root_child1, 1)
        val root_child2 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child2, 50f)
        Yoga.YGNodeStyleSetHeight(root_child2, 10f)
        Yoga.YGNodeInsertChild(root, root_child2, 2)
        val root_child3 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child3, 50f)
        Yoga.YGNodeStyleSetHeight(root_child3, 10f)
        Yoga.YGNodeInsertChild(root, root_child3, 3)
        val root_child4 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child4, 50f)
        Yoga.YGNodeStyleSetHeight(root_child4, 10f)
        Yoga.YGNodeInsertChild(root, root_child4, 4)
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionLTR
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(130f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(10f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(10f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(20f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionRTL
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(130f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(80f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(30f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(80f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(10f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(30f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(10f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(80f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(20f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeFreeRecursive(root)
    }

    @Test
    fun align_content_flex_start_without_height_on_children() {
        val config = Yoga.YGConfigNew()
        val root = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetFlexWrap(root, YGWrap.YGWrapWrap)
        Yoga.YGNodeStyleSetWidth(root, 100f)
        Yoga.YGNodeStyleSetHeight(root, 100f)
        val root_child0 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child0, 50f)
        Yoga.YGNodeInsertChild(root, root_child0, 0)
        val root_child1 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child1, 50f)
        Yoga.YGNodeStyleSetHeight(root_child1, 10f)
        Yoga.YGNodeInsertChild(root, root_child1, 1)
        val root_child2 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child2, 50f)
        Yoga.YGNodeInsertChild(root, root_child2, 2)
        val root_child3 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child3, 50f)
        Yoga.YGNodeStyleSetHeight(root_child3, 10f)
        Yoga.YGNodeInsertChild(root, root_child3, 3)
        val root_child4 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child4, 50f)
        Yoga.YGNodeInsertChild(root, root_child4, 4)
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionLTR
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(10f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(10f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(20f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(0f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionRTL
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(10f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(10f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(20f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(0f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeFreeRecursive(root)
    }

    @Test
    fun align_content_flex_start_with_flex() {
        val config = Yoga.YGConfigNew()
        val root = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetFlexWrap(root, YGWrap.YGWrapWrap)
        Yoga.YGNodeStyleSetWidth(root, 100f)
        Yoga.YGNodeStyleSetHeight(root, 120f)
        val root_child0 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetFlexGrow(root_child0, 1f)
        Yoga.YGNodeStyleSetFlexBasisPercent(root_child0, 0f)
        Yoga.YGNodeStyleSetWidth(root_child0, 50f)
        Yoga.YGNodeInsertChild(root, root_child0, 0)
        val root_child1 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetFlexGrow(root_child1, 1f)
        Yoga.YGNodeStyleSetFlexBasisPercent(root_child1, 0f)
        Yoga.YGNodeStyleSetWidth(root_child1, 50f)
        Yoga.YGNodeStyleSetHeight(root_child1, 10f)
        Yoga.YGNodeInsertChild(root, root_child1, 1)
        val root_child2 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child2, 50f)
        Yoga.YGNodeInsertChild(root, root_child2, 2)
        val root_child3 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetFlexGrow(root_child3, 1f)
        Yoga.YGNodeStyleSetFlexShrink(root_child3, 1f)
        Yoga.YGNodeStyleSetFlexBasisPercent(root_child3, 0f)
        Yoga.YGNodeStyleSetWidth(root_child3, 50f)
        Yoga.YGNodeInsertChild(root, root_child3, 3)
        val root_child4 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child4, 50f)
        Yoga.YGNodeInsertChild(root, root_child4, 4)
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionLTR
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(120f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(40f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(40f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(40f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(80f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(80f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(40f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(120f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(0f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionRTL
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(120f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(40f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(40f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(40f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(80f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(80f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(40f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(120f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(0f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeFreeRecursive(root)
    }

    @Test
    fun align_content_flex_end() {
        val config = Yoga.YGConfigNew()
        val root = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetAlignContent(root, YGAlign.YGAlignFlexEnd)
        Yoga.YGNodeStyleSetFlexWrap(root, YGWrap.YGWrapWrap)
        Yoga.YGNodeStyleSetWidth(root, 100f)
        Yoga.YGNodeStyleSetHeight(root, 100f)
        val root_child0 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child0, 50f)
        Yoga.YGNodeStyleSetHeight(root_child0, 10f)
        Yoga.YGNodeInsertChild(root, root_child0, 0)
        val root_child1 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child1, 50f)
        Yoga.YGNodeStyleSetHeight(root_child1, 10f)
        Yoga.YGNodeInsertChild(root, root_child1, 1)
        val root_child2 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child2, 50f)
        Yoga.YGNodeStyleSetHeight(root_child2, 10f)
        Yoga.YGNodeInsertChild(root, root_child2, 2)
        val root_child3 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child3, 50f)
        Yoga.YGNodeStyleSetHeight(root_child3, 10f)
        Yoga.YGNodeInsertChild(root, root_child3, 3)
        val root_child4 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child4, 50f)
        Yoga.YGNodeStyleSetHeight(root_child4, 10f)
        Yoga.YGNodeInsertChild(root, root_child4, 4)
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionLTR
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(10f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(20f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(30f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(40f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionRTL
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(10f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(20f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(30f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(40f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeFreeRecursive(root)
    }

    @Test
    fun align_content_stretch() {
        val config = Yoga.YGConfigNew()
        val root = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetAlignContent(root, YGAlign.YGAlignStretch)
        Yoga.YGNodeStyleSetFlexWrap(root, YGWrap.YGWrapWrap)
        Yoga.YGNodeStyleSetWidth(root, 150f)
        Yoga.YGNodeStyleSetHeight(root, 100f)
        val root_child0 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child0, 50f)
        Yoga.YGNodeInsertChild(root, root_child0, 0)
        val root_child1 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child1, 50f)
        Yoga.YGNodeInsertChild(root, root_child1, 1)
        val root_child2 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child2, 50f)
        Yoga.YGNodeInsertChild(root, root_child2, 2)
        val root_child3 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child3, 50f)
        Yoga.YGNodeInsertChild(root, root_child3, 3)
        val root_child4 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child4, 50f)
        Yoga.YGNodeInsertChild(root, root_child4, 4)
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionLTR
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(150f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(0f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(0f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionRTL
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(150f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(0f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(0f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeFreeRecursive(root)
    }

    @Test
    fun align_content_spacebetween() {
        val config = Yoga.YGConfigNew()
        val root = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetFlexDirection(root, YGFlexDirection.YGFlexDirectionRow)
        Yoga.YGNodeStyleSetAlignContent(root, YGAlign.YGAlignSpaceBetween)
        Yoga.YGNodeStyleSetFlexWrap(root, YGWrap.YGWrapWrap)
        Yoga.YGNodeStyleSetWidth(root, 130f)
        Yoga.YGNodeStyleSetHeight(root, 100f)
        val root_child0 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child0, 50f)
        Yoga.YGNodeStyleSetHeight(root_child0, 10f)
        Yoga.YGNodeInsertChild(root, root_child0, 0)
        val root_child1 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child1, 50f)
        Yoga.YGNodeStyleSetHeight(root_child1, 10f)
        Yoga.YGNodeInsertChild(root, root_child1, 1)
        val root_child2 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child2, 50f)
        Yoga.YGNodeStyleSetHeight(root_child2, 10f)
        Yoga.YGNodeInsertChild(root, root_child2, 2)
        val root_child3 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child3, 50f)
        Yoga.YGNodeStyleSetHeight(root_child3, 10f)
        Yoga.YGNodeInsertChild(root, root_child3, 3)
        val root_child4 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child4, 50f)
        Yoga.YGNodeStyleSetHeight(root_child4, 10f)
        Yoga.YGNodeInsertChild(root, root_child4, 4)
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionLTR
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(130f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(45f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(45f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(90f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionRTL
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(130f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(80f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(30f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(80f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(45f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(30f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(45f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(80f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(90f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeFreeRecursive(root)
    }

    @Test
    fun align_content_spacearound() {
        val config = Yoga.YGConfigNew()
        val root = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetFlexDirection(root, YGFlexDirection.YGFlexDirectionRow)
        Yoga.YGNodeStyleSetAlignContent(root, YGAlign.YGAlignSpaceAround)
        Yoga.YGNodeStyleSetFlexWrap(root, YGWrap.YGWrapWrap)
        Yoga.YGNodeStyleSetWidth(root, 140f)
        Yoga.YGNodeStyleSetHeight(root, 120f)
        val root_child0 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child0, 50f)
        Yoga.YGNodeStyleSetHeight(root_child0, 10f)
        Yoga.YGNodeInsertChild(root, root_child0, 0)
        val root_child1 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child1, 50f)
        Yoga.YGNodeStyleSetHeight(root_child1, 10f)
        Yoga.YGNodeInsertChild(root, root_child1, 1)
        val root_child2 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child2, 50f)
        Yoga.YGNodeStyleSetHeight(root_child2, 10f)
        Yoga.YGNodeInsertChild(root, root_child2, 2)
        val root_child3 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child3, 50f)
        Yoga.YGNodeStyleSetHeight(root_child3, 10f)
        Yoga.YGNodeInsertChild(root, root_child3, 3)
        val root_child4 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child4, 50f)
        Yoga.YGNodeStyleSetHeight(root_child4, 10f)
        Yoga.YGNodeInsertChild(root, root_child4, 4)
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionLTR
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(140f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(120f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(15f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(15f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(55f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(55f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(95f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionRTL
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(140f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(120f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(90f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(15f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(40f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(15f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(90f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(55f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(40f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(55f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(90f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(95f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeFreeRecursive(root)
    }

    @Test
    fun align_content_stretch_row() {
        val config = Yoga.YGConfigNew()
        val root = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetFlexDirection(root, YGFlexDirection.YGFlexDirectionRow)
        Yoga.YGNodeStyleSetAlignContent(root, YGAlign.YGAlignStretch)
        Yoga.YGNodeStyleSetFlexWrap(root, YGWrap.YGWrapWrap)
        Yoga.YGNodeStyleSetWidth(root, 150f)
        Yoga.YGNodeStyleSetHeight(root, 100f)
        val root_child0 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child0, 50f)
        Yoga.YGNodeInsertChild(root, root_child0, 0)
        val root_child1 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child1, 50f)
        Yoga.YGNodeInsertChild(root, root_child1, 1)
        val root_child2 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child2, 50f)
        Yoga.YGNodeInsertChild(root, root_child2, 2)
        val root_child3 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child3, 50f)
        Yoga.YGNodeInsertChild(root, root_child3, 3)
        val root_child4 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child4, 50f)
        Yoga.YGNodeInsertChild(root, root_child4, 4)
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionLTR
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(150f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionRTL
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(150f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeFreeRecursive(root)
    }

    @Test
    fun align_content_stretch_row_with_children() {
        val config = Yoga.YGConfigNew()
        val root = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetFlexDirection(root, YGFlexDirection.YGFlexDirectionRow)
        Yoga.YGNodeStyleSetAlignContent(root, YGAlign.YGAlignStretch)
        Yoga.YGNodeStyleSetFlexWrap(root, YGWrap.YGWrapWrap)
        Yoga.YGNodeStyleSetWidth(root, 150f)
        Yoga.YGNodeStyleSetHeight(root, 100f)
        val root_child0 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child0, 50f)
        Yoga.YGNodeInsertChild(root, root_child0, 0)
        val root_child0_child0 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetFlexGrow(root_child0_child0, 1f)
        Yoga.YGNodeStyleSetFlexShrink(root_child0_child0, 1f)
        Yoga.YGNodeStyleSetFlexBasisPercent(root_child0_child0, 0f)
        Yoga.YGNodeInsertChild(root_child0, root_child0_child0, 0)
        val root_child1 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child1, 50f)
        Yoga.YGNodeInsertChild(root, root_child1, 1)
        val root_child2 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child2, 50f)
        Yoga.YGNodeInsertChild(root, root_child2, 2)
        val root_child3 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child3, 50f)
        Yoga.YGNodeInsertChild(root, root_child3, 3)
        val root_child4 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child4, 50f)
        Yoga.YGNodeInsertChild(root, root_child4, 4)
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionLTR
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(150f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child0_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child0_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionRTL
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(150f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child0_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child0_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeFreeRecursive(root)
    }

    @Test
    fun align_content_stretch_row_with_flex() {
        val config = Yoga.YGConfigNew()
        val root = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetFlexDirection(root, YGFlexDirection.YGFlexDirectionRow)
        Yoga.YGNodeStyleSetAlignContent(root, YGAlign.YGAlignStretch)
        Yoga.YGNodeStyleSetFlexWrap(root, YGWrap.YGWrapWrap)
        Yoga.YGNodeStyleSetWidth(root, 150f)
        Yoga.YGNodeStyleSetHeight(root, 100f)
        val root_child0 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child0, 50f)
        Yoga.YGNodeInsertChild(root, root_child0, 0)
        val root_child1 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetFlexGrow(root_child1, 1f)
        Yoga.YGNodeStyleSetFlexShrink(root_child1, 1f)
        Yoga.YGNodeStyleSetFlexBasisPercent(root_child1, 0f)
        Yoga.YGNodeStyleSetWidth(root_child1, 50f)
        Yoga.YGNodeInsertChild(root, root_child1, 1)
        val root_child2 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child2, 50f)
        Yoga.YGNodeInsertChild(root, root_child2, 2)
        val root_child3 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetFlexGrow(root_child3, 1f)
        Yoga.YGNodeStyleSetFlexShrink(root_child3, 1f)
        Yoga.YGNodeStyleSetFlexBasisPercent(root_child3, 0f)
        Yoga.YGNodeStyleSetWidth(root_child3, 50f)
        Yoga.YGNodeInsertChild(root, root_child3, 3)
        val root_child4 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child4, 50f)
        Yoga.YGNodeInsertChild(root, root_child4, 4)
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionLTR
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(150f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(0f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionRTL
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(150f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(0f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeFreeRecursive(root)
    }

    @Test
    fun align_content_stretch_row_with_flex_no_shrink() {
        val config = Yoga.YGConfigNew()
        val root = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetFlexDirection(root, YGFlexDirection.YGFlexDirectionRow)
        Yoga.YGNodeStyleSetAlignContent(root, YGAlign.YGAlignStretch)
        Yoga.YGNodeStyleSetFlexWrap(root, YGWrap.YGWrapWrap)
        Yoga.YGNodeStyleSetWidth(root, 150f)
        Yoga.YGNodeStyleSetHeight(root, 100f)
        val root_child0 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child0, 50f)
        Yoga.YGNodeInsertChild(root, root_child0, 0)
        val root_child1 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetFlexGrow(root_child1, 1f)
        Yoga.YGNodeStyleSetFlexShrink(root_child1, 1f)
        Yoga.YGNodeStyleSetFlexBasisPercent(root_child1, 0f)
        Yoga.YGNodeStyleSetWidth(root_child1, 50f)
        Yoga.YGNodeInsertChild(root, root_child1, 1)
        val root_child2 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child2, 50f)
        Yoga.YGNodeInsertChild(root, root_child2, 2)
        val root_child3 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetFlexGrow(root_child3, 1f)
        Yoga.YGNodeStyleSetFlexBasisPercent(root_child3, 0f)
        Yoga.YGNodeStyleSetWidth(root_child3, 50f)
        Yoga.YGNodeInsertChild(root, root_child3, 3)
        val root_child4 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child4, 50f)
        Yoga.YGNodeInsertChild(root, root_child4, 4)
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionLTR
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(150f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(0f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionRTL
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(150f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(0f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeFreeRecursive(root)
    }

    @Test
    fun align_content_stretch_row_with_margin() {
        val config = Yoga.YGConfigNew()
        val root = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetFlexDirection(root, YGFlexDirection.YGFlexDirectionRow)
        Yoga.YGNodeStyleSetAlignContent(root, YGAlign.YGAlignStretch)
        Yoga.YGNodeStyleSetFlexWrap(root, YGWrap.YGWrapWrap)
        Yoga.YGNodeStyleSetWidth(root, 150f)
        Yoga.YGNodeStyleSetHeight(root, 100f)
        val root_child0 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child0, 50f)
        Yoga.YGNodeInsertChild(root, root_child0, 0)
        val root_child1 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetMargin(root_child1, YGEdge.YGEdgeLeft, 10f)
        Yoga.YGNodeStyleSetMargin(root_child1, YGEdge.YGEdgeTop, 10f)
        Yoga.YGNodeStyleSetMargin(root_child1, YGEdge.YGEdgeRight, 10f)
        Yoga.YGNodeStyleSetMargin(root_child1, YGEdge.YGEdgeBottom, 10f)
        Yoga.YGNodeStyleSetWidth(root_child1, 50f)
        Yoga.YGNodeInsertChild(root, root_child1, 1)
        val root_child2 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child2, 50f)
        Yoga.YGNodeInsertChild(root, root_child2, 2)
        val root_child3 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetMargin(root_child3, YGEdge.YGEdgeLeft, 10f)
        Yoga.YGNodeStyleSetMargin(root_child3, YGEdge.YGEdgeTop, 10f)
        Yoga.YGNodeStyleSetMargin(root_child3, YGEdge.YGEdgeRight, 10f)
        Yoga.YGNodeStyleSetMargin(root_child3, YGEdge.YGEdgeBottom, 10f)
        Yoga.YGNodeStyleSetWidth(root_child3, 50f)
        Yoga.YGNodeInsertChild(root, root_child3, 3)
        val root_child4 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child4, 50f)
        Yoga.YGNodeInsertChild(root, root_child4, 4)
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionLTR
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(150f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(40f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(60f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(10f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(20f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(40f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(40f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(60f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(20f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(80f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(20f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionRTL
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(150f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(40f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(40f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(10f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(20f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(40f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(40f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(40f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(20f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(80f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(20f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeFreeRecursive(root)
    }

    @Test
    fun align_content_stretch_row_with_padding() {
        val config = Yoga.YGConfigNew()
        val root = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetFlexDirection(root, YGFlexDirection.YGFlexDirectionRow)
        Yoga.YGNodeStyleSetAlignContent(root, YGAlign.YGAlignStretch)
        Yoga.YGNodeStyleSetFlexWrap(root, YGWrap.YGWrapWrap)
        Yoga.YGNodeStyleSetWidth(root, 150f)
        Yoga.YGNodeStyleSetHeight(root, 100f)
        val root_child0 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child0, 50f)
        Yoga.YGNodeInsertChild(root, root_child0, 0)
        val root_child1 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetPadding(root_child1, YGEdge.YGEdgeLeft, 10f)
        Yoga.YGNodeStyleSetPadding(root_child1, YGEdge.YGEdgeTop, 10f)
        Yoga.YGNodeStyleSetPadding(root_child1, YGEdge.YGEdgeRight, 10f)
        Yoga.YGNodeStyleSetPadding(root_child1, YGEdge.YGEdgeBottom, 10f)
        Yoga.YGNodeStyleSetWidth(root_child1, 50f)
        Yoga.YGNodeInsertChild(root, root_child1, 1)
        val root_child2 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child2, 50f)
        Yoga.YGNodeInsertChild(root, root_child2, 2)
        val root_child3 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetPadding(root_child3, YGEdge.YGEdgeLeft, 10f)
        Yoga.YGNodeStyleSetPadding(root_child3, YGEdge.YGEdgeTop, 10f)
        Yoga.YGNodeStyleSetPadding(root_child3, YGEdge.YGEdgeRight, 10f)
        Yoga.YGNodeStyleSetPadding(root_child3, YGEdge.YGEdgeBottom, 10f)
        Yoga.YGNodeStyleSetWidth(root_child3, 50f)
        Yoga.YGNodeInsertChild(root, root_child3, 3)
        val root_child4 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child4, 50f)
        Yoga.YGNodeInsertChild(root, root_child4, 4)
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionLTR
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(150f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionRTL
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(150f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeFreeRecursive(root)
    }

    @Test
    fun align_content_stretch_row_with_single_row() {
        val config = Yoga.YGConfigNew()
        val root = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetFlexDirection(root, YGFlexDirection.YGFlexDirectionRow)
        Yoga.YGNodeStyleSetAlignContent(root, YGAlign.YGAlignStretch)
        Yoga.YGNodeStyleSetFlexWrap(root, YGWrap.YGWrapWrap)
        Yoga.YGNodeStyleSetWidth(root, 150f)
        Yoga.YGNodeStyleSetHeight(root, 100f)
        val root_child0 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child0, 50f)
        Yoga.YGNodeInsertChild(root, root_child0, 0)
        val root_child1 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child1, 50f)
        Yoga.YGNodeInsertChild(root, root_child1, 1)
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionLTR
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(150f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root_child1))
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionRTL
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(150f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root_child1))
        Yoga.YGNodeFreeRecursive(root)
    }

    @Test
    fun align_content_stretch_row_with_fixed_height() {
        val config = Yoga.YGConfigNew()
        val root = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetFlexDirection(root, YGFlexDirection.YGFlexDirectionRow)
        Yoga.YGNodeStyleSetAlignContent(root, YGAlign.YGAlignStretch)
        Yoga.YGNodeStyleSetFlexWrap(root, YGWrap.YGWrapWrap)
        Yoga.YGNodeStyleSetWidth(root, 150f)
        Yoga.YGNodeStyleSetHeight(root, 100f)
        val root_child0 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child0, 50f)
        Yoga.YGNodeInsertChild(root, root_child0, 0)
        val root_child1 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child1, 50f)
        Yoga.YGNodeStyleSetHeight(root_child1, 60f)
        Yoga.YGNodeInsertChild(root, root_child1, 1)
        val root_child2 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child2, 50f)
        Yoga.YGNodeInsertChild(root, root_child2, 2)
        val root_child3 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child3, 50f)
        Yoga.YGNodeInsertChild(root, root_child3, 3)
        val root_child4 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child4, 50f)
        Yoga.YGNodeInsertChild(root, root_child4, 4)
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionLTR
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(150f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(80f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(60f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(80f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(80f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(20f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(80f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(20f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionRTL
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(150f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(80f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(60f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(80f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(80f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(20f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(80f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(20f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeFreeRecursive(root)
    }

    @Test
    fun align_content_stretch_row_with_max_height() {
        val config = Yoga.YGConfigNew()
        val root = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetFlexDirection(root, YGFlexDirection.YGFlexDirectionRow)
        Yoga.YGNodeStyleSetAlignContent(root, YGAlign.YGAlignStretch)
        Yoga.YGNodeStyleSetFlexWrap(root, YGWrap.YGWrapWrap)
        Yoga.YGNodeStyleSetWidth(root, 150f)
        Yoga.YGNodeStyleSetHeight(root, 100f)
        val root_child0 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child0, 50f)
        Yoga.YGNodeInsertChild(root, root_child0, 0)
        val root_child1 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child1, 50f)
        Yoga.YGNodeStyleSetMaxHeight(root_child1, 20f)
        Yoga.YGNodeInsertChild(root, root_child1, 1)
        val root_child2 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child2, 50f)
        Yoga.YGNodeInsertChild(root, root_child2, 2)
        val root_child3 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child3, 50f)
        Yoga.YGNodeInsertChild(root, root_child3, 3)
        val root_child4 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child4, 50f)
        Yoga.YGNodeInsertChild(root, root_child4, 4)
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionLTR
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(150f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(20f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionRTL
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(150f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(20f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeFreeRecursive(root)
    }

    @Test
    fun align_content_stretch_row_with_min_height() {
        val config = Yoga.YGConfigNew()
        val root = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetFlexDirection(root, YGFlexDirection.YGFlexDirectionRow)
        Yoga.YGNodeStyleSetAlignContent(root, YGAlign.YGAlignStretch)
        Yoga.YGNodeStyleSetFlexWrap(root, YGWrap.YGWrapWrap)
        Yoga.YGNodeStyleSetWidth(root, 150f)
        Yoga.YGNodeStyleSetHeight(root, 100f)
        val root_child0 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child0, 50f)
        Yoga.YGNodeInsertChild(root, root_child0, 0)
        val root_child1 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child1, 50f)
        Yoga.YGNodeStyleSetMinHeight(root_child1, 80f)
        Yoga.YGNodeInsertChild(root, root_child1, 1)
        val root_child2 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child2, 50f)
        Yoga.YGNodeInsertChild(root, root_child2, 2)
        val root_child3 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child3, 50f)
        Yoga.YGNodeInsertChild(root, root_child3, 3)
        val root_child4 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetWidth(root_child4, 50f)
        Yoga.YGNodeInsertChild(root, root_child4, 4)
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionLTR
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(150f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(90f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(90f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(90f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(90f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(90f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionRTL
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(150f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(90f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(90f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(90f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(100f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(90f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(90f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeFreeRecursive(root)
    }

    @Test
    fun align_content_stretch_column() {
        val config = Yoga.YGConfigNew()
        val root = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetAlignContent(root, YGAlign.YGAlignStretch)
        Yoga.YGNodeStyleSetFlexWrap(root, YGWrap.YGWrapWrap)
        Yoga.YGNodeStyleSetWidth(root, 100f)
        Yoga.YGNodeStyleSetHeight(root, 150f)
        val root_child0 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetHeight(root_child0, 50f)
        Yoga.YGNodeInsertChild(root, root_child0, 0)
        val root_child0_child0 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetFlexGrow(root_child0_child0, 1f)
        Yoga.YGNodeStyleSetFlexShrink(root_child0_child0, 1f)
        Yoga.YGNodeStyleSetFlexBasisPercent(root_child0_child0, 0f)
        Yoga.YGNodeInsertChild(root_child0, root_child0_child0, 0)
        val root_child1 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetFlexGrow(root_child1, 1f)
        Yoga.YGNodeStyleSetFlexShrink(root_child1, 1f)
        Yoga.YGNodeStyleSetFlexBasisPercent(root_child1, 0f)
        Yoga.YGNodeStyleSetHeight(root_child1, 50f)
        Yoga.YGNodeInsertChild(root, root_child1, 1)
        val root_child2 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetHeight(root_child2, 50f)
        Yoga.YGNodeInsertChild(root, root_child2, 2)
        val root_child3 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetHeight(root_child3, 50f)
        Yoga.YGNodeInsertChild(root, root_child3, 3)
        val root_child4 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetHeight(root_child4, 50f)
        Yoga.YGNodeInsertChild(root, root_child4, 4)
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionLTR
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(150f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child0_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child0_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(100f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionRTL
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(150f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child0_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child0_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child0_child0))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetTop(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child1))
        assertEquals(0f, Yoga.YGNodeLayoutGetHeight(root_child1))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetTop(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child2))
        assertEquals(50f, Yoga.YGNodeLayoutGetLeft(root_child3))
        assertEquals(100f, Yoga.YGNodeLayoutGetTop(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child3))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child3))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child4))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetWidth(root_child4))
        assertEquals(50f, Yoga.YGNodeLayoutGetHeight(root_child4))
        Yoga.YGNodeFreeRecursive(root)
    }

    @Test
    fun align_content_stretch_is_not_overriding_align_items() {
        val config = Yoga.YGConfigNew()
        val root = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetAlignContent(root, YGAlign.YGAlignStretch)
        val root_child0 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetFlexDirection(root_child0, YGFlexDirection.YGFlexDirectionRow)
        Yoga.YGNodeStyleSetAlignContent(root_child0, YGAlign.YGAlignStretch)
        Yoga.YGNodeStyleSetAlignItems(root_child0, YGAlign.YGAlignCenter)
        Yoga.YGNodeStyleSetWidth(root_child0, 100f)
        Yoga.YGNodeStyleSetHeight(root_child0, 100f)
        Yoga.YGNodeInsertChild(root, root_child0, 0)
        val root_child0_child0 = Yoga.YGNodeNewWithConfig(config)
        Yoga.YGNodeStyleSetAlignContent(root_child0_child0, YGAlign.YGAlignStretch)
        Yoga.YGNodeStyleSetWidth(root_child0_child0, 10f)
        Yoga.YGNodeStyleSetHeight(root_child0_child0, 10f)
        Yoga.YGNodeInsertChild(root_child0, root_child0_child0, 0)
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionLTR
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(100f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child0_child0))
        assertEquals(45f, Yoga.YGNodeLayoutGetTop(root_child0_child0))
        assertEquals(10f, Yoga.YGNodeLayoutGetWidth(root_child0_child0))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child0_child0))
        Yoga.YGNodeCalculateLayout(
            root,
            Yoga.YGUndefined,
            Yoga.YGUndefined,
            YGDirection.YGDirectionRTL
        )
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetWidth(root))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root))
        assertEquals(0f, Yoga.YGNodeLayoutGetLeft(root_child0))
        assertEquals(0f, Yoga.YGNodeLayoutGetTop(root_child0))
        assertEquals(100f, Yoga.YGNodeLayoutGetWidth(root_child0))
        assertEquals(100f, Yoga.YGNodeLayoutGetHeight(root_child0))
        assertEquals(90f, Yoga.YGNodeLayoutGetLeft(root_child0_child0))
        assertEquals(45f, Yoga.YGNodeLayoutGetTop(root_child0_child0))
        assertEquals(10f, Yoga.YGNodeLayoutGetWidth(root_child0_child0))
        assertEquals(10f, Yoga.YGNodeLayoutGetHeight(root_child0_child0))
        Yoga.YGNodeFreeRecursive(root)
    }
}
